#coding=utf-8
import os
import sys
import glob
import fitz

#pip install PyMuPDF

p_na = '0001.pdf'

imagelist = [i for i in os.listdir('./')]

doc = fitz.open()

for image in sorted(imagelist):
    imgdoc = fitz.open(image)
    pdfbytes = imgdoc.convert_to_pdf()
    imgpdf = fitz.open('pdf',pdfbytes)
    doc.insert_pdf(imgpdf)

doc.save(p_na)
doc.close()